package com.michael.study.jetpack.module.dsl

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.widget.Toast
import com.michael.study.jetpack.R
import com.michael.study.jetpack.module.dsl.toast.toast
import com.michael.study.jetpack.module.dsl.user.user

class DslActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_dsl)
        testDsl1()
        testToast()
    }

    private fun testToast() {
        toast {
            context = this@DslActivity
            msg = "提示"
        }
    }

    private fun testDsl1() {
        var user = user {
            name = "liuguoquan"
            password = "123456"
            address {
                province = "Hunan"
                city = "YiYang"
                street = "Yuanjiang"
            }

        }
        Log.d("lgq", "testDsl1: " + user.address?.toString())
    }
}